//
//  MaketIndexDetailTableViewCell.m
//  RedManStock
//
//  Created by lanou3g on 15/7/28.
//  Copyright (c) 2015年 lanou3g. All rights reserved.
//

#import "MaketIndexDetailTableViewCell.h"

@implementation MaketIndexDetailTableViewCell

- (void)awakeFromNib {
    // Initialization code
    
    
//    CGFloat W = [UIScreen mainScreen].bounds.size.width;
//    CGFloat a = (W-300)/5;
//    
//    self.nameLabel.frame = CGRectMake(a, self.nameLabel.frame.origin.y, self.nameLabel.frame.size.width, self.nameLabel.frame.size.height);
//    self.codeLabel.frame = CGRectMake(a, self.codeLabel.frame.origin.y, self.codeLabel.frame.size.width, self.codeLabel.frame.size.height);
//    self.nowPriceLabel.frame = CGRectMake(2*a+75, self.nowPriceLabel.frame.origin.y, self.nowPriceLabel.frame.size.width, self.nowPriceLabel.frame.size.height);
//    self.updownRateLabel.frame = CGRectMake(3*a+150, self.updownRateLabel.frame.origin.y, self.updownRateLabel.frame.size.width, self.updownRateLabel.frame.size.height);
//    self.recommendLabel.frame = CGRectMake(4*a+225, self.recommendLabel.frame.origin.y, self.recommendLabel.frame.size.width, self.recommendLabel.frame.size.height);
    
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}



-(void)setMarketIndex:(MarketIndex *)marketIndex{
    
    if (_marketIndex != marketIndex) {
        _marketIndex = marketIndex;
    }
    
    self.nameLabel.text = marketIndex.name;
    self.codeLabel.text = marketIndex.codeSB;
    self.nowPriceLabel.text = marketIndex.nowPriceSB;
    self.updownRateLabel.text = marketIndex.updownRateSB;
    self.recommendLabel.text = marketIndex.recommendSB;
    
}

-(void)setUpList:(UpList *)upList{
    
    if (_upList == upList) {
        
        _upList = upList;
    }
    
    self.nameLabel.text = upList.name;
    self.codeLabel.text = upList.codeSB;
    self.nowPriceLabel.text = upList.nowPriceSB;
    self.updownRateLabel.text = upList.updownRateSB;
    self.recommendLabel.text = upList.recommendSB;
    
    CGFloat W = self.frame.size.width;
    CGFloat a = (W-300)/5;
    
    self.nameLabel.frame = CGRectMake(a, self.nameLabel.frame.origin.y, self.nameLabel.frame.size.width, self.nameLabel.frame.size.height);
    self.codeLabel.frame = CGRectMake(a, self.codeLabel.frame.origin.y, self.codeLabel.frame.size.width, self.codeLabel.frame.size.height);
    self.nowPriceLabel.frame = CGRectMake(2*a+75, self.nowPriceLabel.frame.origin.y, self.nowPriceLabel.frame.size.width, self.nowPriceLabel.frame.size.height);
    self.updownRateLabel.frame = CGRectMake(3*a+150, self.updownRateLabel.frame.origin.y, self.updownRateLabel.frame.size.width, self.updownRateLabel.frame.size.height);
    self.recommendLabel.frame = CGRectMake(4*a+225, self.recommendLabel.frame.origin.y, self.recommendLabel.frame.size.width, self.recommendLabel.frame.size.height);
    
    
    
}

-(void)setDownList:(DownList *)downList{
    
    if (_downList == downList) {
        
        _downList = downList;
    }
    self.nameLabel.text = downList.name;
    self.codeLabel.text = downList.codeSB;
    self.nowPriceLabel.text = downList.nowPriceSB;
    self.updownRateLabel.text = downList.updownRateSB;
    self.recommendLabel.text = downList.recommendSB;
    
//    CGFloat W = self.frame.size.width;
//    CGFloat a = (W-300)/5;
//    
//    self.nameLabel.frame = CGRectMake(a, self.nameLabel.frame.origin.y, self.nameLabel.frame.size.width, self.nameLabel.frame.size.height);
//    self.codeLabel.frame = CGRectMake(a, self.codeLabel.frame.origin.y, self.codeLabel.frame.size.width, self.codeLabel.frame.size.height);
//    self.nowPriceLabel.frame = CGRectMake(2*a+75, self.nowPriceLabel.frame.origin.y, self.nowPriceLabel.frame.size.width, self.nowPriceLabel.frame.size.height);
//    self.updownRateLabel.frame = CGRectMake(3*a+150, self.updownRateLabel.frame.origin.y, self.updownRateLabel.frame.size.width, self.updownRateLabel.frame.size.height);
//    self.recommendLabel.frame = CGRectMake(4*a+225, self.recommendLabel.frame.origin.y, self.recommendLabel.frame.size.width, self.recommendLabel.frame.size.height);
    
    
}


-(void)setTurn:(TurnoverList *)turn{
    
    if (_turn == turn) {
        
        _turn = turn;
    }
    self.nameLabel.text = turn.name;
    self.codeLabel.text = turn.codeSB;
    self.nowPriceLabel.text = turn.nowPriceSB;
    self.updownRateLabel.text = turn.updownRateSB;
    self.recommendLabel.text = turn.recommendSB;
    
//    CGFloat W = self.frame.size.width;
//    CGFloat a = (W-300)/5;
//    
//    self.nameLabel.frame = CGRectMake(a, self.nameLabel.frame.origin.y, self.nameLabel.frame.size.width, self.nameLabel.frame.size.height);
//    self.codeLabel.frame = CGRectMake(a, self.codeLabel.frame.origin.y, self.codeLabel.frame.size.width, self.codeLabel.frame.size.height);
//    self.nowPriceLabel.frame = CGRectMake(2*a+75, self.nowPriceLabel.frame.origin.y, self.nowPriceLabel.frame.size.width, self.nowPriceLabel.frame.size.height);
//    self.updownRateLabel.frame = CGRectMake(3*a+150, self.updownRateLabel.frame.origin.y, self.updownRateLabel.frame.size.width, self.updownRateLabel.frame.size.height);
//    self.recommendLabel.frame = CGRectMake(4*a+225, self.recommendLabel.frame.origin.y, self.recommendLabel.frame.size.width, self.recommendLabel.frame.size.height);
    
}





@end
